﻿using System;

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FineUI.Examples
{
    public partial class admin_release_notice : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["UserName"] == null)
            {
                Response.Redirect("~/login.aspx");
            }
        }

        protected void btnCreateDoc_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.Notice NT = new Maticsoft.BLL.Notice();
            Maticsoft.Model.Notice NTInfrom = new Maticsoft.Model.Notice();
            string currentN_Id = tbxNoticeNum.Text.ToString();
            if(NT.Exists(currentN_Id))
            {
                Alert.ShowInTop("该公告编号已经存在", MessageBoxIcon.Information);
                return;
            }
            NTInfrom.N_Id = currentN_Id;
            NTInfrom.N_Content = TextAreaNotice.Text.ToString();
            NTInfrom.N_Time = DatePickerTime.Text.ToString();

            if(NT.Add(NTInfrom))
            {
                Alert.ShowInTop("添加新公告成功", MessageBoxIcon.Information);
            }
        }
    }
}